package com.dingup.homework.service;

import com.dingup.api.bean.page.PageData;
import com.dingup.homework.bean.DO.CorrectTeacher;
import com.dingup.homework.bean.DO.HwHomeworkDO;
import com.dingup.homework.bean.DO.HwHomeworkTeacherCorrectDO;
import com.dingup.homework.bean.DTO.TeacherCorrectDTO;
import com.dingup.homework.enums.HomeworkStatusEnum;
import com.dingup.homework.enums.QuestionTypeEnum;

import java.util.Date;

/**
 * Created by wancheng on 2018/11/8.
 */
public interface TeacherCorrectService {
    /**
     * 分发作业是时保存老师记录
     *
     * @param hwHomeworkTeacherCorrectDO
     * @return
     */
    Boolean insert(HwHomeworkTeacherCorrectDO hwHomeworkTeacherCorrectDO);

    /**
     * 模考调用保存老师批改记录的服务
     * @param homeworkRecordId
     * @param examId
     * @param endTime
     * @throws Exception
     */
    void insert(Integer homeworkRecordId, String examId, Date endTime) throws Exception;

    /**
     * 分发作业时 将批改数据保存
     *
     * @param hwHomeworkDO
     */
    void insertBatch(HwHomeworkDO hwHomeworkDO) throws Exception;
    /**
     * 获取老师的批改和未批改列表
     * @param teacherId
     * @param query
     * @param ifCorrect
     * @param page
     * @param rows
     * @return
     */
    PageData<TeacherCorrectDTO> getTeacherCorrectList(String teacherId,
                                                      String query,
                                                      Boolean ifCorrect,
                                                      Integer page,
                                                      Integer rows);

    /**
     * 通过id获取信息
     *
     * @param id
     * @return
     */
    HwHomeworkTeacherCorrectDO getById(Integer id);

    /**
     * 作业批改修改状态
     *
     * @param homeworkTeacherStudentId
     */
    void updateCorrectHomeworkStatus(Integer homeworkTeacherStudentId, HomeworkStatusEnum status);

    void updateCorrectHomeworkStatus(Integer homeworkRecodeId, QuestionTypeEnum type, HomeworkStatusEnum status);

    HwHomeworkTeacherCorrectDO getByBean(HwHomeworkTeacherCorrectDO bean);

    /**
     * 根据批改id修改批改作业老师
     *
     * @param id
     * @param teacherId
     */
    void updateCorrectTeacher(Integer id, String teacherId);

    void updateStatusWhileUpdateHomeworkCorrectTeacher(Integer homeworkId, CorrectTeacher correctTeacher);

    /**
     * 学生完成作业调用接口 修改状态
     *
     * @param homeworkRecordId
     * @param examId
     * @param endTime
     */
    void updateWhenStudentFinish(Integer homeworkRecordId, String examId, Integer examIdentity, Date endTime, HomeworkStatusEnum statusEnum);

    /**
     * 获取未批改作业总数
     *
     * @param teacherId
     * @return
     */
    Integer getUnCorrectListCount(String teacherId);
}
